package com.starlink.model.util;

import com.starlink.model.dtomapper.BannerDtoMapper;
import com.starlink.model.domain.BannerDO;
import com.starlink.model.vo.BannerVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class BannerConvert {

    public static List<BannerVO> buildBannerVoList(List<BannerDO> bannerDOList) {
        if (CollectionUtils.isEmpty(bannerDOList)) {
            return Lists.newArrayList();
        }
        List<BannerVO> bannerVOList = new ArrayList<>();
        for (BannerDO bannerDO : bannerDOList) {
            bannerVOList.add(BannerDtoMapper.INSTANCE.do2VO(bannerDO));
        }

        return bannerVOList;
    }
}
